<template>
  <div>
    <el-button @click="closeDrawer()" size="small" type="primary">导入模板下载</el-button>
    <div style="margin:20px 0"></div>
    <importFile
      :title="'导入'"
      :actionUrl="urls"
      @close="closeHandler"
    />

    <div style="height:47px;"></div>
  </div>
</template>
<script>
import { excelTemplate} from '@/api/omSale/OrderManagement/OrderAuditConfirm';
import moment from 'moment'
import { exportExcelFile2 } from '@/utils';
export default {
  data(){
    return{
      urls:'/api/cmscloud.wholesales/ttVsDeliveryOrderSideC/import',
      fetchParams:{

      },
      fetchApi:()=>{},
    }
  },
  methods:{
    closeDrawer(type){
      this.$confirm('是否将Excel表格保存至本地文件夹?', '提示', {
          confirmButtonText: '下载',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
            this.exportLoading = true;
            excelTemplate()
              .then((response) => {
                exportExcelFile2(response.data,'发运通知导入模板');
                this.exportLoading = false;
              })
              .catch((err) => {
                console.log(err);
              });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });
        });
    },
    closeHandler(val){
      this.$emit('close')
    },

  },
}

</script>
